<?php
require "model/usersreg.php";
//测试账号是否已经注册
class RegtestController{
    function test(){
        $db=new mydb();
        $name = $_GET['username'];
        $sql = "select id from usersreg WHERE username='$name'";
        $obj=$db->doquery($sql);
        if(count($obj)!=0){
            echo 0;//查到ID不为空，提示账号已注册
        }else{
            echo 1;//ID为空，账号可用
        };
    }
}
?>